package com.csglxt.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.csglxt.base.DaoSupportImpl;
import com.csglxt.domain.Supplier;
import com.csglxt.service.SupplierService;

/**
 * 供应商业务实现类
 * 
 * @author Administrator 2015年5月8日 16:47:25
 */

@Service
@Transactional
public class SupplierServiceImpl extends DaoSupportImpl<Supplier> implements
        SupplierService {
    /**
     * 查询供应商是否存在
     */
    public Supplier findSupplierByName(Supplier supplier) {
        return (Supplier) getSession()
                .createQuery("FROM Supplier s where s.name = ?")
                .setParameter(0, supplier.getName()).uniqueResult();

    }

}
